package com.cosc716.restaurant.domain;

import java.util.UUID;

public class Customer {

	private UUID customerId;
	private int eatTime;
	private int arrivalTime;
	private int departureTime;
	
	public Customer(int eatTime) {
		customerId = UUID.randomUUID();
		this.eatTime = eatTime;
	}
	
	public UUID getCustomerId() {
		return customerId;
	}

	public int getArrivalTime() {
		return arrivalTime;
	}

	public void setArrivalTime(int arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	public int getDepartureTime() {
		return departureTime;
	}

	public void setDepartureTime(int departureTime) {
		this.departureTime = departureTime;
	}

	public void eat() {
		if(eatTime > 0) {
			eatTime--;
		}
	}
	
	public int getEatStatus() {
		return eatTime;
	}
	
	@Override
	public boolean equals(Object other) {
		return customerId.equals(((Customer)other).customerId);
	}

	@Override
	public String toString() {
		return "Customer " + customerId;
	}
}
